namespace ThirdLife.UI.WinForms
{
  public class MetaverseServices : IMetaverseUIModuleServices
  {
    private string _url;
    private string _password;
    private string _name;
    private IRenderingEngineFactory _renderingEngineFactory;

    public event ConnectToGridHandler ConnectToGrid;
    public event GenericEventHandler ReadyForRendering;
    public event GenericEventHandler ConnectedToGrid;
    public event GenericEventHandler DisconnectFromGrid;

    public string DefaultURL
    {
      get { return _url; }
      set { _url = value; }
    }

    public string DefaultPassword
    {
      get { return _password; }
      set { _password = value; }
    }

    public string DefaultName
    {
      get { return _name; }
      set { _name = value; }
    }

    public IRenderingEngineFactory RenderingEngineGenerator
    {
      get { return _renderingEngineFactory; }
      set { _renderingEngineFactory = value; }
    }

    public void ConnectToGridWithInfo(string username, string password, string url)
    {
      ConnectToGrid(username, password, url);
    }

    public void NotifyReadyForRendering()
    {
      ReadyForRendering();
    }

    public void NotifyMetaverseConnectivity()
    {
      ConnectedToGrid();
    }

    public void RequestDisconnectionFromMetaverse()
    {
      DisconnectFromGrid();
    }
  }
}